package method1reference;

import java.util.Arrays;

public class Demo3
{
    public static void main(String[] args) {
        //目标：特定类型的方法引用。
        String names[] = {"Tom","Jerry","Mike","Lucy","angela","jack","caocao","曹操"};
//        Arrays.sort(names);
//        System.out.println(Arrays.toString(names));
//    Arrays.sort(names, new Comparator<String>() {
//        @Override
//        public int compare(String o1, String o2) {
//            return o1.compareToIgnoreCase(o2);
//        }
//    });
        //Arrays.sort(names, (o1, o2)-> o1.compareToIgnoreCase(o2));
        Arrays.sort(names, String::compareToIgnoreCase);

      System.out.println(Arrays.toString(names));

    }
}
